package cc.vv.baselibrary.util.http;

import java.util.ArrayList;
import java.util.List;

import cc.vv.baselibrary.util.router.RouterHttpClassKey;

/**
 * Created by sun.li on 2018/7/6.
 *
 * @author sun.li
 */
public class BaseHttpUtil {

    public void post() {
        BaseObjectUtil.getInstance().callMethodInModule(RouterHttpClassKey.KEY_MODULE_HTTP_HTTPUTIL,"test");

        List<BaseObjectParameterBean> beans = new ArrayList<>();
        beans.add(new BaseObjectParameterBean(String.class,"哈哈"));
        beans.add(new BaseObjectParameterBean(Integer.class,88));

        BaseObjectParameterBean baseHttpRequestParameterBean = new BaseObjectParameterBean();
        baseHttpRequestParameterBean.setParameterType(Integer.class);
        beans.add(baseHttpRequestParameterBean);

        BaseObjectUtil.getInstance().callMethodInModule(RouterHttpClassKey.KEY_MODULE_HTTP_HTTPUTIL,"test2",beans);
//        try {
//            Object object = RouterClassUtil.getInstance().getObject(RouterHttpClassKey.KEY_MODULE_HTTP_HTTPUTIL);
//            if (null != object) {
//                Method method = object.getClass().getMethod("test"); // 父类对象调用子类方法(反射原理)
//                method.invoke(object);//执行对象object中通过反射获取的方法
//                Log.e("Method:", method.getName());
//            }
//        }catch (IllegalAccessException e) {
//            e.printStackTrace();
//        } catch (NoSuchMethodException e) {
//            e.printStackTrace();
//        } catch (InvocationTargetException e) {
//            e.printStackTrace();
//        }
    }
}
